<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/index3.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.2.1.js"></script>
    <script src="${pageContext.request.contextPath}/static/My97DatePicker/WdatePicker.js"></script>
</head>

<body>

<form action="./list" method="post">
    订单编号:<input type="text" name="orderNum" value="${ov.orderNum}">
    相关需求:<input type="text" name="need" value="${ov.need}">
    备注:<input type="text" name="remark" value="${ov.remark}"><br>
    订单日期:<input type="text" name="starttime" value="${ov.starttime}">-<input type="text" name="endstime" value="${ov.endstime}"><br>
    总薪酬:<input type="text" name="salary1" value="${ov.salary1}">-<input type="text" name="salary2" value="${ov.salary2}">
    月度总金额:${ov.sum}
    <input type="button" value="查询" onclick="cx()">
</form>

   <table>
       <tr>
           <td>订单日期</td>
           <td>订单编号</td>
           <td>相关需求</td>
           <td>相关资料</td>
           <td>总薪酬</td>
           <td>备注</td>
           <td>制单人工号</td>
           <td>制单人</td>
           <td>制单日期</td>
           <td>操作</td>
       </tr>
       <c:forEach items="${list}" var="li">
           <tr>
               <td><fmt:formatDate value="${li.orderTime}" pattern="yyyy-MM-dd"></fmt:formatDate> </td>
               <td>${li.orderNum}</td>
               <td>${li.orderNeed}</td>
               <td>${li.img}</td>
               <td>${li.salary}</td>
               <td>${li.remark}</td>
               <td>${li.users.userNumber}</td>
               <td>${li.users.userName}</td>
               <td><fmt:formatDate value="${li.tauchingTime}" pattern="yyyy-MM-dd"></fmt:formatDate> </td>
               <td><input type="button" value="删除" onclick="sc(${li.orderId})"></td>
           </tr>
       </c:forEach>
   </table>
<script>
    function cx() {
        $("#nr").load("./list?"+$('form').serialize());
    }
    function sc(obj) {
        alert(obj)
        console.log(obj)
        if(confirm("确定要删除吗?")){
            $.post("del",{id:obj},function (thiz) {
                $("#nr").load(thiz);
            })
        }
    }
</script>
</body>
</html>
